package com.ys.homework;

/**
 * 描述: 圆柱体类
 *
 * @author CodeYang
 * @version 2020/12/15 20:53
 */
public class Cylinder extends Circle {
    /**
     * 高
     */
    private double height;

    public Cylinder() {
    }

    public Cylinder(double radius, double height) {
        super(radius);
        this.height = height;
    }

    /**
     * 获得体积:
     * 底*高
     * @return
     */
    public double getVolume(){
        return super.getArea()*height;
    }
    public void showVolume(){
        super.show();
        System.out.println("height = " + height);
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
}
